home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / sharewar / 40tude / Setup.exe / AUTOSCROLLING IN BROWSER.TXT < prev    next >
Encoding:
Text File  |  1999-12-08  |  702 b   |  31 lines

  1. ///  This script automatically scroll the HTML document.
  2. ///
  3. ///  This script will only work, if the browsers scrollbar is enabled, 
  4. ///  so the document has to be of reasonable length.
  5. ///  Depending on the length of the document you will have to adjust the 
  6. ///  height value at the top of the script.
  7. ///
  8. /// Paste this snippet into the <head> section of your document.
  9. ///
  10. <script language="JavaScript">
  11. <!--
  12. var timer = 0;
  13. var height = 450;
  14. function transport(h)
  15.     {
  16.     window.scroll(0,h)
  17.     setTimeout("polling()",40)
  18.     }
  19. function polling()
  20.     {
  21.     if(timer > height)
  22.         {
  23.         timer = 0
  24.         }
  25.     h = (timer * 6)
  26.     timer++
  27.     transport(h);
  28.     }
  29. setTimeout("polling()",1000)//-->
  30. </script>
  31.